package com.weitu.accidentEvent.osha.service.impl;

import com.weitu.accidentEvent.osha.mapper.LeakageMapper;
import com.weitu.accidentEvent.osha.service.LeakageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * Created by fanyuting on 2017/6/5 0005.
 */
@Service
public class LeakageServiceImpl implements LeakageService {
    @Autowired
    private LeakageMapper leakageMapper;

    @Override
    public List<Map<String, Object>> queryListByParam(Map<String, Object> map) {
        return leakageMapper.queryListByParam(map);
    }

    @Override
    public int queryListCountByParam(Map<String, Object> map) {
        return this.leakageMapper.queryListCountByParam(map);
    }

    @Override
    public Map<String, Object> queryInfoById(String id) {
        return this.leakageMapper.queryInfoById(id);
    }

    @Override
    public boolean addInfo(Map<String, Object> map) {
        int result = this.leakageMapper.insertInfo(map);
        if (result < 1) {
            return false;
        }
        return true;
    }

    @Override
    public boolean editInfo(Map<String, Object> map) {
        int result = this.leakageMapper.updateInfo(map);
        if (result < 1) {
            return false;
        }
        return true;
    }

    @Override
    public boolean deleteInfo(String id) {
        int result = this.leakageMapper.deleteInfo(id);
        if (result < 1) {
            return false;
        }
        return true;
    }
}
